package com.yxr.affairs.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.yxr.affairs.BrActivity;
import com.yxr.affairs.FyActivity;
import com.yxr.affairs.JbActivity;
import com.yxr.affairs.JqActivity;
import com.yxr.affairs.LoginActicity1;
import com.yxr.affairs.MainActivity;
import com.yxr.affairs.QfActivity;
import com.yxr.affairs.R;
import com.yxr.affairs.ShouRuActivity;
import com.yxr.affairs.ZyActivity;
import com.yxr.affairs.base.BaseFragment;
import com.yxr.affairs.utils.UserInfo1;
import com.yxr.affairs.view.ClickImageView;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;


public class InvestFragment extends BaseFragment {


    @BindView(R.id.share_qq_id)
    ClickImageView shareQqId;
    @BindView(R.id.share_winxin_id)
    ClickImageView shareWinxinId;
    @BindView(R.id.share_friends_id)
    ClickImageView shareFriendsId;
    @BindView(R.id.activit_xinxi)
    ClickImageView activitXinxi;
    @BindView(R.id.activit_yiji)
    ClickImageView activitYiji;
    @BindView(R.id.activit_gengduo)
    ClickImageView activitGengduo;
    @BindView(R.id.more)
    ClickImageView more;


    private MainActivity mAActivity;
    private boolean isLoadingMore = false;

    @Override
    protected int attachLayoutRes() {
        return R.layout.fragment_invest;
    }

    @Override
    protected void initViews() {

        if (!UserInfo1.isLogin()) {

            Intent intent = new Intent();
            //SoilsenerActivity.class为想要跳转的Activity
            intent.setClass(getActivity(), LoginActicity1.class);
            startActivity(intent);
        }
        shareQqId.setClickListener(new  ClickImageView.ClickListener() {
            @Override
            public void onClick() {
                if (!UserInfo1.isLogin()) {

                    Intent intent = new Intent();
                    //SoilsenerActivity.class为想要跳转的Activity
                    intent.setClass(getActivity(), LoginActicity1.class);
                    startActivity(intent);
                } else {
                    Intent intent = new Intent();
                    //SoilsenerActivity.class为想要跳转的Activity
                    intent.setClass(getActivity(), ShouRuActivity.class);
                    startActivity(intent);
                }
            }
        });
        shareWinxinId.setClickListener(new  ClickImageView.ClickListener() {
            @Override
            public void onClick() {

                if (!UserInfo1.isLogin()) {

                    Intent intent = new Intent();
                    //SoilsenerActivity.class为想要跳转的Activity
                    intent.setClass(getActivity(), LoginActicity1.class);
                    startActivity(intent);
                } else {
                    Intent intent = new Intent();
                    //SoilsenerActivity.class为想要跳转的Activity
                    intent.setClass(getActivity(), FyActivity.class);
                    startActivity(intent);
                }
            }
        });
        shareFriendsId.setClickListener(new  ClickImageView.ClickListener() {
            @Override
            public void onClick() {
                if (!UserInfo1.isLogin()) {

                    Intent intent = new Intent();
                    //SoilsenerActivity.class为想要跳转的Activity
                    intent.setClass(getActivity(), LoginActicity1.class);
                    startActivity(intent);
                } else {
                    Intent intent = new Intent();
                    //SoilsenerActivity.class为想要跳转的Activity
                    intent.setClass(getActivity(), ZyActivity.class);
                    startActivity(intent);
                }
            }
        });
        activitXinxi.setClickListener(new  ClickImageView.ClickListener() {
            @Override
            public void onClick() {

                if (!UserInfo1.isLogin()) {

                    Intent intent = new Intent();
                    //SoilsenerActivity.class为想要跳转的Activity
                    intent.setClass(getActivity(), LoginActicity1.class);
                    startActivity(intent);
                } else {
                    Intent intent = new Intent();
                    //SoilsenerActivity.class为想要跳转的Activity
                    intent.setClass(getActivity(), BrActivity.class);
                    startActivity(intent);
                }
            }
        });
        activitYiji.setClickListener(new  ClickImageView.ClickListener() {
            @Override
            public void onClick() {

                if (!UserInfo1.isLogin()) {

                    Intent intent = new Intent();
                    //SoilsenerActivity.class为想要跳转的Activity
                    intent.setClass(getActivity(), LoginActicity1.class);
                    startActivity(intent);
                } else {
                    Intent intent = new Intent();
                    //SoilsenerActivity.class为想要跳转的Activity
                    intent.setClass(getActivity(), QfActivity.class);
                    startActivity(intent);
                }
            }
        });
        activitGengduo.setClickListener(new  ClickImageView.ClickListener() {
            @Override
            public void onClick() {

                if (!UserInfo1.isLogin()) {

                    Intent intent = new Intent();
                    //SoilsenerActivity.class为想要跳转的Activity
                    intent.setClass(getActivity(), LoginActicity1.class);
                    startActivity(intent);
                } else {
                    Intent intent = new Intent();
                    //SoilsenerActivity.class为想要跳转的Activity
                    intent.setClass(getActivity(), JbActivity.class);
                    startActivity(intent);
                }
            }
        });
        more.setClickListener(new  ClickImageView.ClickListener() {
            @Override
            public void onClick() {

                if (!UserInfo1.isLogin()) {

                    Intent intent = new Intent();
                    //SoilsenerActivity.class为想要跳转的Activity
                    intent.setClass(getActivity(), LoginActicity1.class);
                    startActivity(intent);
                } else {
                    Intent intent = new Intent();
                    //SoilsenerActivity.class为想要跳转的Activity
                    intent.setClass(getActivity(), JqActivity.class);
                    startActivity(intent);
                }
            }
        });
    }

    @Override
    protected void updateViews(boolean isRefresh) {

    }

    @Override
    protected void onError_(Throwable e) {

    }

    @Override
    protected void onCancel_() {

    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();

        }

}
